Digital imaging systems capture image data using light sensitive sensors. Most image sensors utilize arrays of charge coupled devices (CCDs) or complementary metal-oxide-semiconductor (CMOS) active pixel sensors. CCD and CMOS active pixel sensors are monochrome in that they measure light intensity but do not differentiate between different wavelengths of different colored light. To measure the intensity of light corresponding to a particular color, a filter is placed in front of the sensor to isolate wavelengths of light corresponding to a specific color.
An image is captured by detecting amounts of light corresponding to different color components. In most implementations, the image sensor array is overlaid with a color filter array (CFA) including multiple color filters arranged in a pattern. Light of different frequencies is allowed to pass through the CFA at different locations, such that each sensor in the array samples the intensity of light of only one color component. The data captured from each sensor pixel contains information about only one color, depending on which color filter is positioned over that particular sensor. However, to generate a complete color image, the intensities of three primary color components are required for each pixel.
To determine pixel data of a color image from a CFA sub-sampled image, the intensity of light of missing color components must be interpolated for each pixel from neighboring pixels in the sensor array. This process is commonly referred to as demosaicking.
CCD and CMOS Image sensors provide a sequence of pixels to downstream image processing stages. Raw CFA data is read out of the image sensor array row by row. In order for the CFA interpolation algorithm to work properly, orientation or alignment of the CFA needs to be known so that the algorithm knows which sensors are detecting which color components. The orientation of the CFA is otherwise known as the phase or alignment and such terms are used interchangeably herein.
During placement of a CFA on a sensor array, care normally must be taken to ensure proper alignment. Misalignment may occur as the result of the CFA being shifted to an incorrect phase. Misalignment may result from a shift by a row and/or column of the CFA on the image sensor. Misalignment, if not compensated for, results in severe color distortion of a captured image. Due to multiple possible phase alignments, current CFA interpolation hardware requires the phase of the CFA as an input. The phase may be required to be calculated every time either the sensor changes, or different cropping parameters are programmed into the first active horizontal column, or first active vertical column registers of the sensor.
One or more embodiments of the present invention may address one or more of the above issues.